home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-05-19 | 6.7 KB | 114 lines | [TEXT/MPS ] |
- {
- Created: Monday, April 27, 1992 at 2:50 PM
- ServerEventIntf.p
- Pascal Interface to the Macintosh Libraries
-
- Copyright Apple Computer, Inc. 1990-1992
- All rights reserved
- }
-
- UNIT ServerEventIntf;
-
- INTERFACE
-
- USES
- AppleTalk;
-
- CONST
- { Constants used in the tSEQEntry }
-
- { The SEeventFlag bits in tSEQEntry specify when the server event handler would like to be called. }
- { SEeventFlag bits }
- bCSEHAFPInDoRequest = 0; { An AFP call is starting up (in DoRequest, about to be dispatched) }
- bCSEHAFPInSendResponse = 1; { An AFP call has completed (in SendResponse, about to send out the response) }
- bCSEHServerBusy = 2; { A new session is being denied because the server is busy (socket starvation event) }
- bCSEHServerShutdown = 3; { The server just shut down }
- bCSEHServerControlCall = 4; { A server control call has just completed }
- { NOTE: The following server control calls do not cause a bCSEHServerControlCall server event: }
- { SCStartServer, SCInstallServerEventProc, SCRemoveServerEventProc, SCGetServerEventProc, SCServerVersion, and SCWakeServer. }
- { You can use the bCSEHServerStartup server event to detect server starts and wakeups. }
- bCSEHShare = 5; { An HFS Share trap has just completed }
- bCSEHUnShare = 6; { An HFS UnShare trap has just completed }
- bCSEHSetDirAccess = 7; { An HFS SetDirAccess trap has just completed }
- bCSEHServerNameChange = 8; { An attempt was made to change the server name (the attempt may or may not have been successful) }
- bCSEHVolumePrep = 9; { A new volume was just prepared for use with AppleShare }
- bCSEHVolumeUnmount = 10; { A volume unmount was attempted on an AppleShare volume }
- bCSEHServerStartup = 11; { The server just successfully started up }
- bCSEHSessionTornDown = 12; { A user's session was torn down because any one of a number of reasons, including a }
- { disconnect, server shutdown, timeout, or workstation initiated close session }
- bCSEHOutOfSequence = 13; { A packet was received out of sequence; the session may be a zombie }
- bCSEHWksClosedSession = 14; { A workstation closed its ASP session (i.e., it logged out) }
- bCSEHSessionTimedOut = 15; { A workstation's session timed out }
- bCSEHSrvrClosedSession = 16; { The server has closed a workstation's session }
-
- { When SEeventFlag bits bCSEHAFPInDoRequest or bCSEHAFPInSendResponse are set, the bits in SEwhichAFPFlag }
- { determine which AFP calls will cause the server event handler to be called. }
- { SEwhichAFPFlag bits }
- { bit 0 of SEwhichAFPFlag[1] - call SE handler when the AFPCommand = 192 (afpAddIcon) }
- { bit 1 of SEwhichAFPFlag[1] - call SE handler when the AFPCommand = 1 }
- { bit 2 of SEwhichAFPFlag[1] - call SE handler when the AFPCommand = 2 }
- { ... }
- { bit 31 of SEwhichAFPFlag[1] - call SE handler when the AFPCommand = 31 }
- { bit 0 of SEwhichAFPFlag[0] - call SE handler when the AFPCommand = 32 }
- { ... }
- { bit 63 of SEwhichAFPFlag[0] - call SE handler when the AFPCommand = 63 }
-
- { When SEeventFlag bit bCSEHServerControlCall is set, the bits in SEwhichSCFlag determine }
- { which server control calls will cause the server event handler to be called. }
- { SEwhichSCFlag bits }
- { bit 0 of SEwhichSCFlag - call SE handler when scCode = 0 (SCStartServer) }
- { ... }
- { bit 31 of SEwhichSCFlag - call SE handler when scCode = 31 }
-
- BufferMax = 48; { The maximum size of theBuffer in the ServerEventRecord }
-
-
- TYPE
- ServerEventRecordPtr = ^ServerEventRecord;
- ServerEventRecord = RECORD
- theEventNumber: LongInt; { the server event that's occuring; see the SEeventFlag definitions above }
- theServerTime: LongInt; { the server time (in Macintosh DateTime form) }
- theResult: OSErr; { the result of the operation: }
- { if theEventNumber = bCSEHAFPInSendResponse: the AFP Error code to be returned }
- { if theEventNumber = bCSEHServerControlCall: the result of the server control call }
- { if theEventNumber = bCSEHShare, bCSEHUnShare, or bCSEHSetDirAccess: the result of the HFS call }
- { if theEventNumber = bCSEHServerNameChange: the result of a PRegisterName call, SECantRegNameErr, or SEDupNameErr }
- { if theEventNumber = bCSEHVolumeUnmount: noErr or fBsyErr (if volume is being used by a remote user) }
- { all other values of theEventNumber return noErr}
- theBufSize: Integer; { the number of bytes used in theBuffer }
- theBuffer: PACKED ARRAY[1..BufferMax] OF Byte;
- { if theEventNumber = bCSEHAFPInDoRequest or bCSEHAFPInSendResponse: the first BufferMax bytes of the AFP packet }
- { if theEventNumber = bCSEHServerControlCall: the first BufferMax bytes of the SCParamBlockRec }
- { if theEventNumber = bCSEHShare, bCSEHUnShare, bCSEHSetDirAccess, bCSEHVolumePrep, or bCSEHVolumeUnmount: }
- { the first BufferMax bytes of the HParamBlockRec }
- { if theEventNumber = bCSEHServerNameChange: the new server name (in a Pascal string) }
- { all other values of theEventNumber return a zero length buffer }
- theNameStr: Str31; { the name of the file, if any; not always defined }
- theAFPCommand: Integer; { if theEventNumber = bCSEHAFPInDoRequest or bCSEHAFPInSendResponse, the AFP call number }
-
- { Note: If theEventNumber is bCSEHAFPInDoRequest, bCSEHAFPInSendResponse, bCSEHSessionTornDown, bCSEHOutOfSequence, }
- { bCSEHWksClosedSession, bCSEHSessionTimedOut, or bCSEHSrvrClosedSession, then theUNRecID, theUNSUserID, }
- { theUserName, and theSocketAddress of the user that made the call are returned.}
-
- theUNRecID: LongInt; {the UNRecID of the user that made the call}
- theUNSUserID: LongInt; {the UserID of the user that made the call}
- theUserName: Str31; {the name of the user that made the call}
-
- { Note: If theEventNumber is bCSEHAFPInDoRequest or bCSEHAFPInSendResponse, then theVRefNum and theDirID will be }
- { returned if applicable to the AFP call}
-
- theVRefNum: Integer; { the VRefNum of the volume upon which this operation was performed (not always applicable) }
- theDirID: LongInt; { the DirID of the directory upon/within which this operation was performed (not always applicable)}
- theSocketAddress: AddrBlock; { the network address of the user's workstation in AddrBlock format }
- END;
-
- tSEQEntryPtr = ^tSEQEntry;
- tSEQEntry = RECORD
- SEQentry: ATQEntry; { a regular AppleTalk Transition Queue entry }
- SEeventFlag: LongInt; { specifies when the Server Event Handler would like to be called }
- SEwhichAFPFlag: ARRAY[0..1] OF LongInt; { specifies which AFP calls will cause the Server Event Handler to be called }
- SEwhichSCFlag: LongInt; { specifies which Server Control calls will cause the Server Event Handler to be called }
- END;
-
- IMPLEMENTATION
- END.